﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UWP.Douban.Api;
using UWP.Douban.Models;
using Windows.UI.Xaml.Navigation;

namespace UWP.Douban.Mvvm
{
    public class MyTopicVm:BaseVm
    {
        public MyTopicVm()
        {
            MyTopics = new ObservableCollection<Topic>();
        }

        public ObservableCollection<Topic> MyTopics { get; private set; }


        public override async void OnNavigatedTo(NavigationEventArgs e)
        {
            var topics = await GroupApi.GpsearchMyTopics();

            //var topics = await SampleData.SampleDataUtil.GetTopics();

            foreach (var topic in topics)
            {
                MyTopics.Add(topic);
            }

            base.OnNavigatedTo(e);
        }


    }
}
